package site.syksy.qingzhou.setting.runner;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;
import site.syksy.qingzhou.database.service.TablesService;
import site.syksy.qingzhou.setting.constant.TableNameConstant;

/**
 * @author Raspberry
 */
@Slf4j
@Component
public class InitSettingTable implements CommandLineRunner {

    @Autowired
    TablesService tablesService;

    @Override
    public void run(String... args) {
        initTemplate();
    }

    public void initTemplate() {
        tablesService.initData(TableNameConstant.class);
    }

}
